package com.henu.engineer.dao.mapper.cultivatingproject

import com.henu.engineer.dao.entity.cultivatingproject.GraduationRequirement
import org.apache.ibatis.annotations.Mapper
import org.springframework.stereotype.Repository
import java.time.LocalDate

/**
 *
 * @author noexcept
 * @since 2021/8/10 14:22
 */
@Mapper
@Repository
interface GraduationRequirementXmlMapper {

    fun insertSingle(name: String, content: String, version: String, specialization: String): Boolean

    fun deleteSingleById(id: Int): Boolean

    fun deleteByVersion(version: String): Int

    fun updateNameContentById(id: Int, name: String, content: String): Boolean

    fun updateVersionByVersion(oldVersion: String, newVersion: String): Int

    fun selectById(id: Int): GraduationRequirement?

    /**
     * @param spec 专业
     * @param version 版本
     */
    fun selectBySpecAndVersion(spec: String, version: String): List<GraduationRequirement>


    /**
     * 查询某专业最新版本
     */
    fun selectLatestVersionBySpec(specialization: String): String?
}